package algorithm.poj.p3000;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLDecoder;


/**
 * 分析：
 * 
 * 实现：
 * 
 * 经验：
 * 
 * 教训：
 * 
 * @author wong.tong@gmail.com
 *
 */
public class P3299 {

	public static void main(String[] args) throws Exception {

		InputStream input = null;
		if (false) {
			input = System.in;
		} else {
			URL url = P3299.class.getResource("P3299.txt");
			File file = new File(URLDecoder.decode(url.getPath(), "UTF-8"));
			input = new FileInputStream(file);
		}
		
		BufferedReader stdin = new BufferedReader(new InputStreamReader(input));

		String line = stdin.readLine();
        while (line != null && !"E".equals(line.trim())) {
        	Double T = null, D = null, H = null;
        	String[] tmp = line.split(" ");
        	if ("T".equals(tmp[0])) T = Double.valueOf(tmp[1]);
        	if ("T".equals(tmp[2])) T = Double.valueOf(tmp[3]);
        	if ("D".equals(tmp[0])) D = Double.valueOf(tmp[1]);
        	if ("D".equals(tmp[2])) D = Double.valueOf(tmp[3]);
        	if ("H".equals(tmp[0])) H = Double.valueOf(tmp[1]);
        	if ("H".equals(tmp[2])) H = Double.valueOf(tmp[3]);
        	if (T == null) {
        		double e = 6.11f * Math.exp(5417.7530f * ((1.0f/273.16f) - (1.0f/(D+273.16f))));
        		double h = 0.5555f * (e - 10.0f);
        		T = H - h;
        	} else if (D == null) {
        		double h = H - T;
        		double e = h/0.5555f + 10.0f;
        		D = 1.0f/((1.0f/273.16f) - Math.log(e/6.11f)/5417.7530f) - 273.16f;
        	} else {
        		double e = 6.11f * Math.exp(5417.7530f * ((1.0f/273.16f) - (1.0f/(D+273.16f))));
        		double h = 0.5555f * (e - 10.0f);
        		H = T + h;
        	}
        	System.out.println("T " + (Math.floor(T*10+0.5)/10.0f) 
        			+ " D " + (Math.floor(D*10+0.5)/10.0f) 
        			+ " H " + (Math.floor(H*10+0.5)/10.0f));
            line = stdin.readLine();
        }
	}

}
